package com.ellricky.teacher.ui.mycourse.ammet

import com.ellricky.baselib.http.callback.ECallback
import com.ellricky.baselib.ui.base.BaseDetailActivity
import com.ellricky.teacher.API_AM_MEET_DETAIL
import com.ellricky.teacher.R
import com.ellricky.teacher.TcAmMeetDetailEntity
import kotlinx.android.synthetic.main.tc_activity_am_meet_detail.*

class AmMeetDetailActivity : BaseDetailActivity() {

    override fun getChildContentLayout(): Int {
        return R.layout.tc_activity_am_meet_detail
    }


    override fun initUIView() {
        super.initUIView()
        mTvTitle.text = getString(R.string.tc_am_meet_detail)
        loadDetail(id)

    }

    private fun loadDetail(id: String) {
        mPresenter.loadDetail(
                API_AM_MEET_DETAIL, id, object : ECallback<TcAmMeetDetailEntity>(this) {
            override fun onSuccess(data: TcAmMeetDetailEntity?, msg: String) {
                data?.let {
                    tvTitle.text = it.meetTitle
                    tvAreaName.text = it.areaName
                    tvFzTeacher.value = it.name
                    tvDate.value = it.meetDate
                    tvContent.text = it.meetInfo
                }
            }
        })

    }
}
